#ifndef _SOCK_SERVER_H_
#define _SOCK_SERVER_H_

#include "sockclient.h"

/************************************************************************/
/* Provides server side sockets                                         */
/************************************************************************/
class SocketServer : public Socket {

public:

	/************************************************************************/
	/* Creates socket server instance                                       */
	/************************************************************************/
	SocketServer(int addressFamily = AF_INET, int type = SOCK_STREAM, int protocol = IPPROTO_TCP);

	/************************************************************************/
	/* Bind to sockets required data for connections                        */
	/************************************************************************/
	bool bindPoint(int port, const char * ip = NULL);

	/************************************************************************/
	/* Listens port for input connection									*/
	/************************************************************************/
	bool listenConnection(int timeout);

	/************************************************************************/
	/* Accepts input connection and returns connection client's socket      */
	/************************************************************************/
	SocketClient * acceptConnection();
};

#endif //_SOCK_SERVER_H_
